<%@ page contentType="text/html;charset=utf-8" language="java"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@include file="./common/base.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>有而就是有范儿</title>
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/common.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
<script type="text/javascript" src="js/js.js"></script>
</head>

<body>
<div class="outer-wrapper">
<%@ include  file="./common/header.jsp"%>
    <!--content -->
    <div class="content clear">
    	<div class="user-private">
        	<div class="user-private-detail" id="user-private-detail" style="display:none">
            	<div class="user-private-top"></div>
         
                <div class="form-user">
            	<form action="#" method="#" name="form-user-private">
                	<p><label class="">用户名</label><span>尧尧</span></p>
                	<p><label class="">邮箱</label><span>xiaoxiao@163.com</span></p>
                	<p><label class="">性别</label><input type="radio" value="male" checked="checked" name="sex"/>男<input type="radio" value="female" name="sex"/>女</p>
              		<p><label class="">生日</label>
                		<select>
                			<option value="2014">2014</option>
                        	<option value="2014">2013</option>
                        	<option value="2014">2012</option>
                       		<option value="2014">2011</option>
                        	<option value="2014">2010</option>
                        	<option value="2014">2009</option>					
                		</select>年
                    	<select>
                			<option value="jan">1</option>
                        	<option value="feb">2</option>
                        	<option value="mar">3</option>
                        	<option value="apr">4</option>
                        	<option value="may">5</option>
                        	<option value="jun">6</option>
                        	<option value="jul">7</option>	
                        	<option value="aug">8</option>	
                        	<option value="sep">9</option>
                        	<option value="cot">10</option>
                        	<option value="nov">11</option>						
                		</select>月
                    	<select>
                			<option>1</option>
                        	<option>2</option>
                        	<option>3</option>
                        	<option>4</option>
                        	<option>5</option>
                        	<option>6</option>					
                		</select>日                    
                	</p>
              		<p><label class="">手机</label><input type="tel" name="mobile" class="mobile" /></p>
              		<input type="submit" name="submit" class="btn user-sumit-btn" value="应用"/>
                </form>
                </div>
            </div>
            
            
            <div class="user-private-psw" id="user-private-psw"  >
            	<div class="user-private-top"></div>
                <!--form box  -->
                <div class="form-user">
           		<form action="#" method="#"  name="form-user-psw">
                	<p><label for="original-psw">原始密码</label><input type="password" name="original-psw"  id="original-psw-id" class="original-psw"/></p>
                    <p><label for="new-psw">新密码</label><input type="password" name="new-psw" id="new-psw-id" class="new-psw"/></p>
                    <p><label for="confirm-psw">重复新密码</label><input type="password" name="confirm-psw" id="confirm-psw-id" class="confirm-psw"/></p>
                	<input type="button" name="submit" class="btn user-sumit-btn" value="应用" onclick="modifyPwd();"/>
                </form>
                </div><!--form box end -->
            </div><!-- user reset the psw end-->
        </div>
    </div><!--content end -->
    <!--footer -->
  		<%@ include  file="./common/footer.jsp"%>
    <!--footer end -->
</div>
    
<script type="text/javascript">
function modifyPwd(){
	objp= {}
	var originPwd = $("#original-psw-id").val();
	var newPwd = $("#new-psw-id").val();
	var confirmPwd = $("#confirm-psw-id").val();
	if (originPwd==null ||originPwd=="") {
		alert("原始密码不能为空");return;
	}
	if (newPwd==null ||newPwd=="") {
		alert("新密码不能为空");return;
	}
	if (confirmPwd==null ||confirmPwd=="") {
		alert("确认密码不能为空");return;
	}
	if(newPwd!=confirmPwd) {
		alert("两次密码输入不一致");return;
	}
	
	objp.oldPwd = originPwd;
	objp.newPwd = newPwd;
	   $.ajax({
			  url: '${path}/core/modifyPwd',
			  type: 'POST',
			  timeout: 30000,
			  cache : false,
		      data :objp,
		      async: false,
			  success:function(msg){
				  alert("修改成功");
				  location=location;
			   },
			   failure:function(msg){
				   alert(eval('('+msg.responseText+')').error_text);
			   		
			   },
			   error:function(msg){
				   alert(eval('('+msg.responseText+')').error_text); 
			   }
		});
}
</script>

</body>
</html>
